import {
    WebSocketGateway,
    SubscribeMessage,
    WebSocketServer,
  } from '@nestjs/websockets';
  
  @WebSocketGateway()
  export class MessageGateway {
    @WebSocketServer() server;
  
    @SubscribeMessage('events')
    onEvent(client, data) {
      return data ;
    }
    
    emit(data){
      this.server.emit('events',data);
    }
  }